package com.bishe.dao;

import com.bishe.pojo.Org;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * 部门数据层
 * @date 2022/03/20 42:08:37
 */
public interface OrgDao {

    @Select("select * from org")
    List<Org> findAll();


    @Select("select * from org where id = #{id}")
    Org findById(@Param("id") String id);

    @Delete("delete  from org where id = #{id}")
    void deleteById(@Param("id") String id);


    @Update("update org set id = #{id},pid = #{pid},name = #{name} where id = #{id}")
    void updateById(Org org);


    @Insert("insert into org (id,pid,name) values(#{id},#{pid},#{name})")
    void save(Org org);
}
